
import java.util.concurrent.*;

/**
 * @Author：KoVaVo
 * @Version：1.0.0
 * @Description：
 */
public class test {



    public static void main(String[] args) {
        ExecutorService threadPoolExecutor = new ThreadPoolExecutor(4, 4, 0, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(7), Executors.defaultThreadFactory(),
                new myhandler());

        for (int i = 0; i < 5; i++) {

        }


    }

    public static void testThread(){
        System.out.println("thead");
    }

    static class myhandler implements RejectedExecutionHandler{
        public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
            if (executor.getQueue().size()<1000){

            }
        }
    }


}


